#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int x;
  vector<int> ret;

  cin >> x;
  while (x > 0) {
    ret.emplace_back(x % 10);
    x /= 10;
  }
  sort(ret.begin(), ret.end());
  for (int i = 0; i < ret.size(); i++) {
    if (ret[i]) {
      cout << ret[i];
      for (int j = 0; j < ret.size(); j++) {
        if (i != j) {
          cout << ret[j];
        }
      }
      break;
    }
  }
  return 0;
}